All the functions names that can be called from outside the
smart contract
Function signatures (function names, argument types, and
return types)
Events in the contract
However, the ABI does not contain the details of the function or the
event’s implementation.
The ABI is used outside the smart contract by the Ethereum client
libraries like web3 to interact with the smart contract. Hence, it would
need only the details of the functions of the public and external
types. Only the public and external types of functions are part of the
ABI interface, which means the private and internal types are not
represented. The reason being that ABI is used for integration with
the front-end code.
For an example, please compile the following code:
// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract Covid19Testing {
uint numberOfPositivePatients;
event NewPositiveFound(address fromAddress, uint number); //
Event
function testForCovidPositivePublic() public {
// if a new positive is found
emit NewPositiveFound(msg.sender,
++numberOfPositivePatients); // Triggering event
}
function testForCovidPositivePublicInternal() internal {
emit NewPositiveFound(msg.sender,
++numberOfPositivePatients); // Triggering event
}
function testForCovidPositivePublicExternal() external {
emit NewPositiveFound(msg.sender,
++numberOfPositivePatients); // Triggering event